Merged
Conversation
Collaborator
CatarinaGamboa
left a comment
There was a problem hiding this comment.
Merge previous PR and rebase pls. These are too many files to review 😅
Collaborator
Author
|
Sure thing! Let me just finish up #126. |
- Add ArgumentMismatchError - Check argument count and types of aliases - Add not found error for aliases as well - Add locations to LJErrors after catching them in the places they don't include positions
- Validate ghost invocations instead of relying on Z3 output - Throw LJErrors in AST expressions
bc9c458 to
ea9d845
Compare
CatarinaGamboa
requested changes
Dec 4, 2025
Collaborator
CatarinaGamboa
left a comment
There was a problem hiding this comment.
left some comments
liquidjava-verifier/src/main/java/liquidjava/rj_language/ast/Expression.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| // no overload matched, use the first candidate to throw the error | ||
| GhostFunction g = candidates.get(0); |
Collaborator
There was a problem hiding this comment.
Could we provide the hints in here instead of creating an error with the first candidate? Like "gh(int) not found. Maybe you meant gh(double), gh(int, double)"
Similar to what you did on the warning for external method not found
Collaborator
Author
There was a problem hiding this comment.
Definitely! I'll do that in another PR with more cases.
| * | ||
| * @throws LJError | ||
| */ | ||
| public void validateGhostInvocations(Context ctx, Factory f) throws LJError { |
Collaborator
There was a problem hiding this comment.
this method is too long. check the suggestions i left, it might improve. If not, we might need to split this into smaller bits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the problem mentioned in #126, where we were getting a not found error instead of an argument mismatch error on wrong alias invocations, because we were not validating them beforehand. Also, we were previously relying on the Z3 output to get ghost invocation errors. Instead, we now also validate ghost calls before sending them to the SMT solver. For both ghosts and aliases, in either wrong argument count or types, the
ArgumentMismatchErrorwas introduced.